﻿using System.Runtime.InteropServices;

namespace FileUDClassLibrary
{
    /// <summary>
    /// 文件类型
    /// </summary>
    public enum FileType
    {
        /// <summary>
        /// 未知
        /// </summary>
        UNKNOWN,
        /// <summary>
        /// Excel文档
        /// </summary>
        EXCEL,
        /// <summary>
        /// Word文档
        /// </summary>
        WORD,
        /// <summary>
        /// Txt文档
        /// </summary>
        TXT,
        /// <summary>
        /// Jpg图片
        /// </summary>
        JPG,
        /// <summary>
        /// Png图片
        /// </summary>
        PNG,
        /// <summary>
        /// Gif图片
        /// </summary>
        GIF,
        /// <summary>
        /// Pdf文档
        /// </summary>
        PDF
    }

    /// <summary>
    /// 当前文件的状态
    /// </summary>
    public enum FileState
    {
        /// <summary>
        /// 发生错误
        /// </summary>
        ERROR,
        /// <summary>
        /// 等待
        /// </summary>
        WAIT,
        /// <summary>
        /// 上传中
        /// </summary>
        UPING,
        /// <summary>
        /// 完成
        /// </summary>
        FINISH
    }

    /// <summary>
    /// 发送文件状态
    /// </summary>
    public enum SendFileState
    {
        /// <summary>
        /// 不是在发文件
        /// </summary>
        NoSend,
        /// <summary>
        /// 握手
        /// </summary>
        Handshake,
        /// <summary>
        /// 可以发送
        /// </summary>
        CanSend,
        /// <summary>
        /// 正在发送
        /// </summary>
        Sending
    }

    /// <summary>
    /// 文件信息
    /// </summary>
    public struct SendFileInfo
    {
        /// <summary>
        /// 文件名称
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 255)]
        public string FileName;

        /// <summary>
        /// 文件大小
        /// </summary>
        public long FileSize;
    }
}
